﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Employee/MasterPageEmployee.master" AutoEventWireup="true" CodeFile="CreateInterview.aspx.cs" Inherits="Employee_CreateInterview" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <link type="text/css" href="Styles/EmployeeStyleSheet.css" rel="Stylesheet" />
    <script type="text/javascript" src="../Scripts/jquery.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#<%=ddltitlevacancy.ClientID %>').blur(function () {
                if ($('#<%=ddltitlevacancy.ClientID %>').val() == "Please choise title vacancy") {
                    $('#<%=lblErrortitlevacancy.ClientID %>').html("(*)");
                }
                else {
                    $('#<%=lblErrortitlevacancy.ClientID %>').html("");
                }
                hidebutton();
            });
            $('#<%=ddlApplicant.ClientID %>').blur(function () {
                if ($('#<%=ddlApplicant.ClientID %>').val() == "Please choise Applicant") {
                    $('#<%=lblErrorApplicant.ClientID %>').html("(*)");
                }
                else {
                    $('#<%=lblErrorApplicant.ClientID %>').html("");
                }
                hidebutton();
            });
            $('#<%=ddlInterviewer.ClientID %>').blur(function () {
                if ($('#<%=ddlInterviewer.ClientID %>').val() == "Please choise Interviewer") {
                    $('#<%=lblErrorInterviewer.ClientID %>').html("(*)");
                }
                else {
                    $('#<%=lblErrorInterviewer.ClientID %>').html("");
                }
                hidebutton();
            });
            $('#<%=txtDateInterview.ClientID %>').blur(function () {
                if ($('#<%=txtDateInterview.ClientID %>').val() == "") {
                    $('#<%=lblErrorDateInterview.ClientID %>').html("(*)");
                }
                else {
                    $('#<%=lblErrorDateInterview.ClientID %>').html("");
                }
                hidebutton();
            });
            $('#<%=txtTimeStart.ClientID %>').blur(function () {
                if ($('#<%=txtTimeStart.ClientID %>').val() == "") {
                    $('#<%=lblErrorTime.ClientID %>').html("(*)");
                }
                else {
                    $('#<%=lblErrorTime.ClientID %>').html("");
                }
                hidebutton();
            });
            function hidebutton() {
                if ($('#<%=ddltitlevacancy.ClientID %>').val() == "Please choise title vacancy") {
                    $('#<%=btnCreate.ClientID %>').attr('disabled', true);
                }
                else if ($('#<%=ddlApplicant.ClientID %>').val() == "Please choise Applicant") {
                    $('#<%=btnCreate.ClientID %>').attr('disabled', true);
                }
                else if ($('#<%=ddlInterviewer.ClientID %>').val() == "Please choise Interviewer") {
                    $('#<%=btnCreate.ClientID %>').attr('disabled', true);
                }
                else if ($('#<%=txtDateInterview.ClientID %>').val() == "") {
                    $('#<%=btnCreate.ClientID %>').attr('disabled', true);
                }
                else if ($('#<%=txtTimeStart.ClientID %>').val() == "") {
                    $('#<%=btnCreate.ClientID %>').attr('disabled', true);
                }
                else {
                    $('#<%=btnCreate.ClientID %>').attr('disabled', false);
                }
            };
            $('#<%=txtDateInterview.ClientID %>').click(function () {
                $('#DivCalendar').css('display', 'block');
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentmain" Runat="Server">
    <div id="MainCreateInterview">
        <h2>Create a new Interview</h2>
        <p>
            <asp:Label ID="lblVacancy" runat="server" Height="20px" 
                Width="180px">Title Vacancy:</asp:Label>
            <asp:DropDownList ID="ddltitlevacancy" runat="server" 
                CssClass="CVinput" Height="20px" Width="204px" AutoPostBack="True" 
                onselectedindexchanged="ddltitlevacancy_SelectedIndexChanged">
                <asp:ListItem Selected="True">Please choise title vacancy</asp:ListItem>
            </asp:DropDownList>
            <asp:Label ID="lblErrortitlevacancy" runat="server" ForeColor="Red"></asp:Label>
        </p>
        <p>
            <asp:Label ID="lblAplicant" runat="server" Text="Applicant Name:" Height="20px" 
                Width="180px"></asp:Label>
            <asp:DropDownList ID="ddlApplicant" runat="server" Height="20px" Width="204px">
                <asp:ListItem Selected="True">Please choise Applicant</asp:ListItem>
            </asp:DropDownList>
            <asp:Label ID="lblErrorApplicant" runat="server" ForeColor="Red"></asp:Label>
        </p>
        <p>
            <asp:Label ID="lblInterviewer" runat="server" Text="Interviewer:" Height="20px" 
                Width="180px"></asp:Label>
            <asp:DropDownList ID="ddlInterviewer" runat="server" Height="20px" 
                Width="204px">
                <asp:ListItem Selected="True">Please choise Interviewer</asp:ListItem>
            </asp:DropDownList>
            <asp:Label ID="lblErrorInterviewer" runat="server" ForeColor="Red"></asp:Label>
        </p>
        <p>
            <asp:Label ID="lblDateInterview" runat="server" Text="Date Interview:" 
                Height="20px" Width="180px"></asp:Label>
            <asp:TextBox ID="txtDateInterview" runat="server" CssClass="CVinput" 
                Height="20px" Width="200px"></asp:TextBox>
            <asp:CalendarExtender ID="txtDateInterview_CalendarExtender" runat="server" 
                TargetControlID="txtDateInterview">
            </asp:CalendarExtender>
            <asp:Label ID="lblErrorDateInterview" runat="server" ForeColor="Red"></asp:Label>
        </p>
        <p>
            <asp:Label ID="lblTimeDetails" runat="server" Text="Time Details:" 
                Height="20px" Width="180px"></asp:Label>
            <asp:TextBox ID="txtTimeStart" runat="server" CssClass="CVinput" 
                Width="200px"></asp:TextBox>
                <asp:Label ID="lblErrorTime" runat="server" ForeColor="Red"></asp:Label>
        </p>
        <p>
            <asp:Label ID="lblEmployeeCreate" runat="server" Text="Employee Create:" 
                Height="20px" Width="180px"></asp:Label>
            <asp:TextBox ID="txtEmployeeCreate" runat="server" CssClass="CVinput" 
                Width="200px" Enabled="False"></asp:TextBox>
        </p>
        <p>
            <asp:Label ID="lblStatus" runat="server" Text="Status:" Height="20px" 
                Width="180px"></asp:Label>
            <asp:DropDownList ID="ddlStatus" runat="server" CssClass="CVinput" 
                Height="20px" Width="100px" Enabled="False">
                <asp:ListItem Selected="True">Suspeded</asp:ListItem>
            </asp:DropDownList>
        </p>
        <p style="text-align: center;"><asp:Label ID="lblError" runat="server" Text="" ForeColor="Red"></asp:Label>
            <asp:Label ID="lblSuccess" runat="server" ForeColor="Blue"></asp:Label>
        </p>
        <p id="button">
            <asp:Button ID="btnCreate" runat="server" Text="Create" Height="30px" 
                Width="100px" onclick="btnCreate_Click" ToolTip="Create new Vacancy" />
            <asp:Button ID="btnClear" runat="server" Text="Clear" Height="30px" 
                Width="100px" onclick="btnClear_Click" ToolTip="Clear all textbox" />
        </p>
    </div>
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
</asp:Content>

